#include <QtGui/QApplication>
#include "qmlapplicationviewer.h"
#include <QDeclarativeContext>

#include "database.h"

Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QApplication> app(createApplication(argc, argv));

    QmlApplicationViewer viewer;
    database data(&viewer,viewer.rootContext());
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);

    //viewer.rootContext()->setContextProperty("myData", &data);
    //viewer.rootContext()->setContextProperty("myExpenses", &data.expenseM);
    //viewer.rootContext()->setContextProperty("myAccounts", &data.accountM);
    //viewer.rootContext()->setContextProperty("myNames", data.names);
    //viewer.rootContext()->setContextProperty("myTrips", data.tripsList);
    //viewer.rootContext()->setContextProperty("myExpense", data.exp);

    viewer.setSource(QUrl("qrc:/qml/main.qml"));
    viewer.showExpanded();

    return app->exec();
}
